using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Domains
{
    /// <summary>
    /// <para>Create Domain</para>
    /// <para>Creates an attribute domain in the specified workspace.</para>
    /// <para>在指定的工作空间中创建属性域。</para>
    /// </summary>    
    [DisplayName("Create Domain")]
    public class CreateDomain : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateDomain()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para>The geodatabase that will contain the new domain.</para>
        /// <para>将包含新属性域的地理数据库。</para>
        /// </param>
        /// <param name="_domain_name">
        /// <para>Domain Name</para>
        /// <para>The name of the domain that will be created.</para>
        /// <para>将创建的域的名称。</para>
        /// </param>
        public CreateDomain(object _in_workspace, object _domain_name)
        {
            this._in_workspace = _in_workspace;
            this._domain_name = _domain_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Domain";

        public override string CallName => "management.CreateDomain";

        public override List<string> AcceptEnvironments => ["autoCommit", "workspace"];

        public override object[] ParameterInfo => [_in_workspace, _domain_name, _domain_description, _field_type.GetGPValue(), _domain_type.GetGPValue(), _split_policy.GetGPValue(), _merge_policy.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>The geodatabase that will contain the new domain.</para>
        /// <para>将包含新属性域的地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Domain Name</para>
        /// <para>The name of the domain that will be created.</para>
        /// <para>将创建的域的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _domain_name { get; set; }


        /// <summary>
        /// <para>Domain Description</para>
        /// <para>The description of the domain that will be created.</para>
        /// <para>将要创建的域的说明。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _domain_description { get; set; } = null;


        /// <summary>
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of attribute domain that will be created. Attribute domains are rules that describe the accepted values of a field type. Specify a field type that matches the data type of the field to which the attribute domain will be assigned.</para>
        ///   <bulletList>
        ///     <bullet_item>Text—A text type field will be created that contains a string of characters.</bullet_item><para/>
        ///     <bullet_item>Float (single precision)— A float type field will be created that contains fractional numbers between -3.4E38 and 1.2E38.</bullet_item><para/>
        ///     <bullet_item>Double (double precision)— A double type field will be created that contains fractional numbers between -2.2E308 and 1.8E308.</bullet_item><para/>
        ///     <bullet_item>Short (small integer)— A short type field will be created that contains whole numbers between -32,768 and 32,767.</bullet_item><para/>
        ///     <bullet_item>Long (large integer)— A long type field will be created that contains whole numbers between -2,147,483,648 and 2,147,483,647.</bullet_item><para/>
        ///     <bullet_item>Date—A date type field will be created that contains a date and/or time.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将创建的属性域的类型。属性域是描述字段类型的接受值的规则。指定与属性域将分配到的字段的数据类型相匹配的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>文本 - 将创建一个包含字符串的文本类型字段。</bullet_item><para/>
        ///     <bullet_item>浮点数（单精度）- 将创建一个浮点型字段，其中包含介于 -3.4E38 和 1.2E38 之间的小数。</bullet_item><para/>
        ///     <bullet_item>双精度（双精度）— 将创建一个双精度字段，其中包含介于 -2.2E308 和 1.8E308 之间的小数。</bullet_item><para/>
        ///     <bullet_item>短（小整数）— 将创建一个短类型字段，其中包含 -32,768 和 32,767 之间的整数。</bullet_item><para/>
        ///     <bullet_item>长（大整数）— 将创建一个长类型字段，其中包含 -2,147,483,648 和 2,147,483,647 之间的整数。</bullet_item><para/>
        ///     <bullet_item>日期 - 将创建包含日期和/或时间的日期类型字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _field_type_value _field_type { get; set; } = _field_type_value._SHORT;

        public enum _field_type_value
        {
            /// <summary>
            /// <para>Short (small integer)</para>
            /// <para>Short (small integer)— A short type field will be created that contains whole numbers between -32,768 and 32,767.</para>
            /// <para>短（小整数）— 将创建一个短类型字段，其中包含 -32,768 和 32,767 之间的整数。</para>
            /// </summary>
            [Description("Short (small integer)")]
            [GPEnumValue("SHORT")]
            _SHORT,

            /// <summary>
            /// <para>Long (large integer)</para>
            /// <para>Long (large integer)— A long type field will be created that contains whole numbers between -2,147,483,648 and 2,147,483,647.</para>
            /// <para>长（大整数）— 将创建一个长类型字段，其中包含 -2,147,483,648 和 2,147,483,647 之间的整数。</para>
            /// </summary>
            [Description("Long (large integer)")]
            [GPEnumValue("LONG")]
            _LONG,

            /// <summary>
            /// <para>Float (single precision)</para>
            /// <para>Float (single precision)— A float type field will be created that contains fractional numbers between -3.4E38 and 1.2E38.</para>
            /// <para>浮点数（单精度）- 将创建一个浮点型字段，其中包含介于 -3.4E38 和 1.2E38 之间的小数。</para>
            /// </summary>
            [Description("Float (single precision)")]
            [GPEnumValue("FLOAT")]
            _FLOAT,

            /// <summary>
            /// <para>Double (double precision)</para>
            /// <para>Double (double precision)— A double type field will be created that contains fractional numbers between -2.2E308 and 1.8E308.</para>
            /// <para>双精度（双精度）— 将创建一个双精度字段，其中包含介于 -2.2E308 和 1.8E308 之间的小数。</para>
            /// </summary>
            [Description("Double (double precision)")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

            /// <summary>
            /// <para>Text</para>
            /// <para>Text—A text type field will be created that contains a string of characters.</para>
            /// <para>文本 - 将创建一个包含字符串的文本类型字段。</para>
            /// </summary>
            [Description("Text")]
            [GPEnumValue("TEXT")]
            _TEXT,

            /// <summary>
            /// <para>Date</para>
            /// <para>Date—A date type field will be created that contains a date and/or time.</para>
            /// <para>日期 - 将创建包含日期和/或时间的日期类型字段。</para>
            /// </summary>
            [Description("Date")]
            [GPEnumValue("DATE")]
            _DATE,

        }

        /// <summary>
        /// <para>Domain Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the domain type that will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Coded value domain—A coded type domain will be created that contains a valid set of values for an attribute. This is the default. For example, a coded value domain can specify valid pipe material values such as CL—cast iron pipe, DL—ductile iron pipe, or ACP—asbestos concrete pipe.</bullet_item><para/>
        ///     <bullet_item>Range domain—A range type domain will be created that contains a valid range of values for a numeric attribute. For example, if distribution water mains have a pressure between 50 and 75 psi, a range domain specifies these minimum and maximum values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将创建的域类型。</para>
        ///   <bulletList>
        ///     <bullet_item>编码值属性域 - 将创建一个编码类型属性域，其中包含属性的一组有效值。这是默认设置。例如，编码值域可以指定有效的管道材料值，例如 CL—铸铁管、DL—球墨铸铁管或 ACP—石棉混凝土管。</bullet_item><para/>
        ///     <bullet_item>范围属性域 - 将创建一个范围类型属性域，其中包含数值属性的有效值范围。例如，如果配水总管的压力在 50 到 75 psi 之间，则范围域指定这些最小值和最大值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _domain_type_value _domain_type { get; set; } = _domain_type_value._CODED;

        public enum _domain_type_value
        {
            /// <summary>
            /// <para>Coded value domain</para>
            /// <para>Coded value domain—A coded type domain will be created that contains a valid set of values for an attribute. This is the default. For example, a coded value domain can specify valid pipe material values such as CL—cast iron pipe, DL—ductile iron pipe, or ACP—asbestos concrete pipe.</para>
            /// <para>编码值属性域 - 将创建一个编码类型属性域，其中包含属性的一组有效值。这是默认设置。例如，编码值域可以指定有效的管道材料值，例如 CL—铸铁管、DL—球墨铸铁管或 ACP—石棉混凝土管。</para>
            /// </summary>
            [Description("Coded value domain")]
            [GPEnumValue("CODED")]
            _CODED,

            /// <summary>
            /// <para>Range domain</para>
            /// <para>Range domain—A range type domain will be created that contains a valid range of values for a numeric attribute. For example, if distribution water mains have a pressure between 50 and 75 psi, a range domain specifies these minimum and maximum values.</para>
            /// <para>范围属性域 - 将创建一个范围类型属性域，其中包含数值属性的有效值范围。例如，如果配水总管的压力在 50 到 75 psi 之间，则范围域指定这些最小值和最大值。</para>
            /// </summary>
            [Description("Range domain")]
            [GPEnumValue("RANGE")]
            _RANGE,

        }

        /// <summary>
        /// <para>Split Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies the split policy that will be used for the created domain. The behavior of an attribute's values when a feature that is split is controlled by its split policy.</para>
        ///   <bulletList>
        ///     <bullet_item>Use the attribute's default value—The attributes of the two resulting features will use the default value of the attribute of the given feature class or subtype.</bullet_item><para/>
        ///     <bullet_item>Duplicate attribute values—The attribute of the two resulting features will use a copy of the original object's attribute value.</bullet_item><para/>
        ///     <bullet_item>Use geometric ratio—The attributes of resulting features will be a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, each new feature's attribute gets one-half the value of the original object's attribute. The geometry ratio policy only applies to range domains.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于所创建域的拆分策略。当分割的要素受其分割策略控制时，属性值的行为。</para>
        ///   <bulletList>
        ///     <bullet_item>使用属性的默认值 - 两个生成要素的属性将使用给定要素类或子类型的属性的默认值。</bullet_item><para/>
        ///     <bullet_item>重复属性值 - 两个生成要素的属性将使用原始对象属性值的副本。</bullet_item><para/>
        ///     <bullet_item>使用几何比率 - 生成要素的属性将为原始要素值的比率。该比率基于将原始几何图形划分为的比例。如果几何被平均划分，则每个新要素的属性将获得原始对象属性值的一半。几何比率策略仅适用于范围域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _split_policy_value _split_policy { get; set; } = _split_policy_value._DEFAULT;

        public enum _split_policy_value
        {
            /// <summary>
            /// <para>Use the attribute's default value</para>
            /// <para>Use the attribute's default value—The attributes of the two resulting features will use the default value of the attribute of the given feature class or subtype.</para>
            /// <para>使用属性的默认值 - 两个生成要素的属性将使用给定要素类或子类型的属性的默认值。</para>
            /// </summary>
            [Description("Use the attribute's default value")]
            [GPEnumValue("DEFAULT")]
            _DEFAULT,

            /// <summary>
            /// <para>Duplicate attribute values</para>
            /// <para>Duplicate attribute values—The attribute of the two resulting features will use a copy of the original object's attribute value.</para>
            /// <para>重复属性值 - 两个生成要素的属性将使用原始对象属性值的副本。</para>
            /// </summary>
            [Description("Duplicate attribute values")]
            [GPEnumValue("DUPLICATE")]
            _DUPLICATE,

            /// <summary>
            /// <para>Use geometric ratio</para>
            /// <para>Use geometric ratio—The attributes of resulting features will be a ratio of the original feature's value. The ratio is based on the proportion into which the original geometry is divided. If the geometry is divided equally, each new feature's attribute gets one-half the value of the original object's attribute. The geometry ratio policy only applies to range domains.</para>
            /// <para>使用几何比率 - 生成要素的属性将为原始要素值的比率。该比率基于将原始几何图形划分为的比例。如果几何被平均划分，则每个新要素的属性将获得原始对象属性值的一半。几何比率策略仅适用于范围域。</para>
            /// </summary>
            [Description("Use geometric ratio")]
            [GPEnumValue("GEOMETRY_RATIO")]
            _GEOMETRY_RATIO,

        }

        /// <summary>
        /// <para>Merge Policy</para>
        /// <para><xdoc>
        ///   <para>Specifies the merge policy that will be used for the created domain. When two features are merged into a single feature, merge policies control attribute values in the new feature.</para>
        ///   <bulletList>
        ///     <bullet_item>Use the attribute's default value—The attribute of the resulting feature will use the default value of the attribute of the given feature class or subtype. This is the only merge policy that applies to nonnumeric fields and coded value domains.</bullet_item><para/>
        ///     <bullet_item>Sum of the values—The attribute of the resulting feature will use the sum of the values from the original feature's attribute. The sum values policy only applies to range domains.</bullet_item><para/>
        ///     <bullet_item>Area weighted average—The attribute of the resulting feature will be the weighted average of the attribute values of the original features. This average is based on the original feature's geometry. The area weighted policy only applies to range domains.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于所创建域的合并策略。当两个要素合并为一个要素时，合并策略将控制新要素中的属性值。</para>
        ///   <bulletList>
        ///     <bullet_item>使用属性的默认值 - 生成要素的属性将使用给定要素类或子类型的属性的默认值。这是适用于非数值字段和编码值属性域的唯一合并策略。</bullet_item><para/>
        ///     <bullet_item>值之和 - 生成要素的属性将使用原始要素属性中的值之和。总和值策略仅适用于范围域。</bullet_item><para/>
        ///     <bullet_item>面积加权平均 - 生成要素的属性将为原始要素属性值的加权平均值。此平均值基于原始要素的几何。区域加权策略仅适用于范围域。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merge Policy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _merge_policy_value _merge_policy { get; set; } = _merge_policy_value._DEFAULT;

        public enum _merge_policy_value
        {
            /// <summary>
            /// <para>Use the attribute's default value</para>
            /// <para>Use the attribute's default value—The attribute of the resulting feature will use the default value of the attribute of the given feature class or subtype. This is the only merge policy that applies to nonnumeric fields and coded value domains.</para>
            /// <para>使用属性的默认值 - 生成要素的属性将使用给定要素类或子类型的属性的默认值。这是适用于非数值字段和编码值属性域的唯一合并策略。</para>
            /// </summary>
            [Description("Use the attribute's default value")]
            [GPEnumValue("DEFAULT")]
            _DEFAULT,

            /// <summary>
            /// <para>Sum of the values</para>
            /// <para>Sum of the values—The attribute of the resulting feature will use the sum of the values from the original feature's attribute. The sum values policy only applies to range domains.</para>
            /// <para>值之和 - 生成要素的属性将使用原始要素属性中的值之和。总和值策略仅适用于范围域。</para>
            /// </summary>
            [Description("Sum of the values")]
            [GPEnumValue("SUM_VALUES")]
            _SUM_VALUES,

            /// <summary>
            /// <para>Area weighted average</para>
            /// <para>Area weighted average—The attribute of the resulting feature will be the weighted average of the attribute values of the original features. This average is based on the original feature's geometry. The area weighted policy only applies to range domains.</para>
            /// <para>面积加权平均 - 生成要素的属性将为原始要素属性值的加权平均值。此平均值基于原始要素的几何。区域加权策略仅适用于范围域。</para>
            /// </summary>
            [Description("Area weighted average")]
            [GPEnumValue("AREA_WEIGHTED")]
            _AREA_WEIGHTED,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public CreateDomain SetEnv(int? autoCommit = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, workspace: workspace);
            return this;
        }

    }

}